<style>		
	.ke-icon-pic {
		background-image: url(./keditor/themes/default/default.png);
		background-position: 0px -1232px;
		width: 16px;
		height: 16px;
	}
</style>
<link rel="stylesheet" type="text/css" href="style.css" />
<script charset="utf-8" src="/keditor/kindeditor.js"></script>
<script charset="utf-8" src="/keditor/lang/zh_CN.js"></script>
<div class="container-fluid">
	<div class="row-fluid">
		<div class="span2">
			<div class="accordion" id="accordion2">
				<div class="accordion-group">
					<div class="accordion-heading">
						<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
						消息列表
						</a>
					</div>
					<div id="collapseTwo" >
						<div class="accordion-inner">
						 <ul class="nav nav-list">
							<li class="nav-header"><a href="/letter/teacher">老师(<*$tnum*>)</a></li>
							<li class="active"><a href="/letter/team">运维</a></li>
						 </ul>
						</div>
					</div>
				</div>
				<div class="accordion-group">
					<div class="accordion-heading">
					<a class="accordion-toggle" href="/letter/send">
					发送消息
					</a>
					</div>
				</div>
				<div class="accordion-group">
					<div class="accordion-heading">
						<a class="accordion-toggle" href="/letter/recycle">
						回收站
						</a>
					</div>
				</div>
                </div>						   
		</div>
		<div class="span10">
<fieldset><legend>运维消息</legend></fieldset>
  <table class="table table-hover">
			 <tr><th>班级</th><th>机构|校区</th><th>内容</th><th>发信时间</th><th>操作</th></tr>
			<*foreach from=$team item=tm*>
		   <tr>
			   <td><*$tm.classname*></td>
			   <td>|<*$tm.groupname*>|<*$tm.schoolname*></td><td><*$tm.content*></td><td><*$tm.addtime*></td>
			   <td>
			     <a href='/letter/see/lid/<*$tm.lid*>'>查看</a>|
				 <a href='/letter/delete/lid/<*$tm.lid*>'>删除</a>
			   </td>
		   </tr>
		 <*/foreach*>
		 <tr><td colspan="5"> <*$topage*></td> </tr>
		 </table>
	</div>
</div>
   





<script>
$(function(){
 $('#letter').hide();
 $('#hid').hide();
 $('#group').change(function(){
	$.get("/letter/school/groupid/"+$(this).val(),
	function(data){
	    $('#school').empty();
	    $('#school').append("<option value=''>--请选择学校--</option>"+data);
	});
 })
 $('#school').change(function(){
    var sid = $(this).val();
	var gid = $('#group').val();
	$.get("/letter/class/gid/"+gid+"/sid/"+sid,
	function(data){
	    $('#class').empty();
	    $('#class').append("<option value=''>--请选择学校--</option>"+data);
	});	
 })
 $('#class').change(function(){
   $('#letter').show(); 
 })
$('#tj').click(function(){
		    // alert($('#editor_id').val());
			// <!-- $('#editor_id').html(); -->
				 KindEditor.instances[0].html('');
			KindEditor.instances[0].html('<img alt="" src="/keditor/attached/image/20131025/20131025154726_70671.png" />');
		
		   })
  
})
KindEditor.plugin('pic', function(K) {
	var self = this, name = 'pic';
	self.clickToolbar(name, function() {
	editor.loadPlugin('pic', function() {
						editor.plugin.multiImageDialog({
							clickFn : function(urlList) {
								var div = K('#J_imageView');
								div.html('');
								K.each(urlList, function(i, data) {
									div.append('<img src="' + data.url + '">');
								});
								editor.hideDialog();
							}
						});
					});
	//self.insertHtml('<strong>测试内容</strong>');
	});
});
KindEditor.ready(function(K) {
	K.each({
		'plug-align' : {
			name : '对齐方式',
			method : {
				'justifyleft' : '左对齐',
				'justifycenter' : '居中对齐',
				'justifyright' : '右对齐'
			}
		},
		'plug-order' : {
			name : '编号',
			method : {
				'insertorderedlist' : '数字编号',
				'insertunorderedlist' : '项目编号'
			}
		},
		'plug-indent' : {
			name : '缩进',
			method : {
				'indent' : '向右缩进',
				'outdent' : '向左缩进'
			}
		}
	},function( pluginName, pluginData ){
		var lang = {};
		lang[pluginName] = pluginData.name;
		KindEditor.lang( lang );
		KindEditor.plugin( pluginName, function(K) {
			var self = this;
			self.clickToolbar( pluginName, function() {
				var menu = self.createMenu({
						name : pluginName,
						width : pluginData.width || 100
					});
				K.each( pluginData.method, function( i, v ){
					menu.addItem({
						title : v,
						checked : false,
						iconClass : pluginName+'-'+i,
						click : function() {
							self.exec(i).hideMenu();
						}
					});
				})
			});
		});
	});
	K.create('#content', {
		themeType : 'qq',
		items : [						'bold','italic','underline','fontname','fontsize','forecolor','hilitecolor','plug-align','plug-order','plug-indent','link','pic','multiimage',
		],
		allowFileManager : true
	});
	var editor = K.editor({
					allowFileManager : true
				});
				K('#J_selectImage').click(function() {
					editor.loadPlugin('multiimage', function() {
						editor.plugin.multiImageDialog({
							clickFn : function(urlList) {
								var div = K('#J_imageView');
								div.html('');
								K.each(urlList, function(i, data) {
									div.append('<img src="' + data.url + '">');
								});
								editor.hideDialog();
							}
						});
					});
				});
});
KindEditor.ready(function(K) {
				var editor = K.editor({
					allowFileManager : true
				});
				K('#J_selectImage').click(function() {
					editor.loadPlugin('multiimage', function() {
						editor.plugin.multiImageDialog({
							clickFn : function(urlList) {
								var div = K('#J_imageView');
								div.html('');
								K.each(urlList, function(i, data) {
									div.append('<img src="' + data.url + '">');
								});
								editor.hideDialog();
							}
						});
					});
				});
			});
</script>
